/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.can.be;

import edu.upn.sigemfi.ope.be.Moneda;
import edu.upn.sigemfi.plt.be.Cuenta;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

/**
 *
 * @author Jhosep
 */
@Entity
@Table(name = "CAN_TRANSACCION_INTERNA_WEB")
@NamedQueries({
    @NamedQuery(name = "TransaccionInternaWeb.findAll", query = "SELECT t FROM TransaccionInternaWeb t")
    // @NamedQuery(name = "TransaccionInternaWeb.findByIdTransaccionInternaWeb", query = "SELECT t FROM TransaccionInternaWeb t WHERE t.idTransaccionInternaWeb = :idTransaccionInternaWeb")
})
@PrimaryKeyJoinColumn(name = "ID_TRANSACCION_INTERNA_WEB", referencedColumnName = "ID_TRANSACCION_WEB")
@DiscriminatorValue(value = "TINT")

public class TransaccionInternaWeb extends TransaccionWeb implements Serializable {

    @JoinColumn(name = "FID_CAN_TRANSACCION_WEB", referencedColumnName = "ID_TRANSACCION_WEB")
    @ManyToOne(fetch = FetchType.LAZY)
    private TransaccionWeb fidCanTransaccionWeb;
    @JoinColumn(name = "FID_CAN_CUENTA_DESTINO", referencedColumnName = "ID_CUENTA")
    @ManyToOne(fetch = FetchType.LAZY)
    private Cuenta fidCanCuentaDestino;

    public TransaccionInternaWeb() {
    }

    public Cuenta getFidCanCuentaDestino() {
        return fidCanCuentaDestino;
    }

    public void setFidCanCuentaDestino(Cuenta fidCanCuentaDestino) {
        this.fidCanCuentaDestino = fidCanCuentaDestino;
    }

    public TransaccionInternaWeb(TransaccionWeb fidCanTransaccionWeb) {
        this.fidCanTransaccionWeb = fidCanTransaccionWeb;
    }

    public TransaccionWeb getFidCanTransaccionWeb() {
        return fidCanTransaccionWeb;
    }

    public void setFidCanTransaccionWeb(TransaccionWeb fidCanTransaccionWeb) {
        this.fidCanTransaccionWeb = fidCanTransaccionWeb;
    }

   @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTransaccionWeb != null ? idTransaccionWeb.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TransaccionWeb)) {
            return false;
        }
        TransaccionWeb other = (TransaccionWeb) object;
        if ((this.idTransaccionWeb == null && other.idTransaccionWeb != null) || (this.idTransaccionWeb != null && !this.idTransaccionWeb.equals(other.idTransaccionWeb))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.can.be.TransaccionWeb[idTransaccionWeb=" + idTransaccionWeb + "]";
    }
}
